Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Android] Expose channel buffer resize and overflow calls #44434

Conversation

bleroux
Copy link
Contributor

@bleroux bleroux commented Aug 7, 2023

Description

This PR updates the Android engine in order to provide a more efficient implementation for BasicMessageChannel.resizeChannelBuffer (helper to call the resize control command).
It also adds a new helper calledBasicMessageChannel.allowChannelBufferOverflow to call the overflow control command.

Related Issue

Fixes flutter/flutter#132048
Android implementation for flutter/flutter#132386

Tests

Adds 2 tests.

@chinmaygarde
Copy link
Member

cc @reidbaker for routing to a reviewer. There doesn't seem to be a motivating use case in the linked issue so that would be good to suss out too.

@bleroux
Copy link
Contributor Author

bleroux commented Aug 11, 2023

FYI, I assigned Hixie and Jason as reviewers because:

@Hixie
Copy link
Contributor

Hixie commented Aug 11, 2023

Looks good to me but my Java is rusty, best to have someone more familiar with this code review it.

@bleroux bleroux changed the title [Android] Optimize channel buffer resize and overflow calls [Android] Expose channel buffer resize and overflow calls Aug 16, 2023
@chinmaygarde
Copy link
Member

May I land this?

@chinmaygarde
Copy link
Member

I'm so sorry. I misclicked closing this.

@bleroux bleroux force-pushed the android_add_channel_buffer_utilities_resize_and_overflow branch from 50cb021 to 2cdd66a Compare August 17, 2023 20:53
@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 18, 2023
@auto-submit auto-submit bot merged commit 2f9a4ef into flutter:main Aug 18, 2023
@bleroux bleroux deleted the android_add_channel_buffer_utilities_resize_and_overflow branch August 18, 2023 06:31
zanderso pushed a commit to flutter/flutter that referenced this pull request Aug 18, 2023
…132857)

flutter/engine@58f7d8e...83fdada

2023-08-18 [email protected] Update Impeller
benchmarks.md with a Pixel 7 link (flutter/engine#44834)
2023-08-18 [email protected] Roll Fuchsia Linux SDK from
7xOzci7fempFgHNk9... to pSqQ556xmZp7S4np5... (flutter/engine#44846)
2023-08-18 [email protected] Roll Dart SDK from
121fcbd8124c to 8109103e041b (1 revision) (flutter/engine#44844)
2023-08-18 [email protected] [Impeller] add trace events for
VkRenderPass and VkFrameBuffer creation. (flutter/engine#44837)
2023-08-18 [email protected] Roll Fuchsia Mac SDK from
Tnp43n_nAR2N0l_gY... to onEHyyETXAMieDyfP... (flutter/engine#44845)
2023-08-18 [email protected] Roll Skia from 1e62a2d4c429 to
c9294edc03b9 (2 revisions) (flutter/engine#44843)
2023-08-18 [email protected] [Android] Expose channel buffer resize
and overflow calls (flutter/engine#44434)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from 7xOzci7fempF to pSqQ556xmZp7
  fuchsia/sdk/core/mac-amd64 from Tnp43n_nAR2N to onEHyyETXAMi

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the
revert to ensure that a human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
)

## Description

This PR updates the Android engine in order to provide a more efficient implementation for `BasicMessageChannel.resizeChannelBuffer` (helper to call the `resize` control command).
It also adds a new helper called`BasicMessageChannel.allowChannelBufferOverflow` to call the `overflow` control command.

## Related Issue

Fixes flutter/flutter#132048
Android implementation for flutter/flutter#132386

## Tests

Adds 2 tests.
auto-submit bot pushed a commit that referenced this pull request Sep 19, 2023
#44848)

## Description

This PR update the helper function that invokes the control channel 'resize' command (previous implementation relied on a deprecated format). It also adds a similar helper function for the 'overflow' commands exposed by the control channel.

See:

https://github.com/flutter/engine/blob/93e8901490e78c7ba7e319cce4470d9c6478c6dc/lib/ui/channel_buffers.dart#L302-L309

## Related Issue

iOS and macOS implementation for flutter/flutter#132386

Similar implementations:
- Android: #44434
- Linux: #44636

## Tests

Adds two tests.
auto-submit bot pushed a commit that referenced this pull request Sep 28, 2023
#46361)

## Description

This PR is a follow-up to #44434 which introduces the `allowChannelBufferOverflow` function. It renames this function to `setWarnsOnChannelOverflow`.

The previous naming was inspired by the framework side implementation.
https://github.com/flutter/engine/blob/93e8901490e78c7ba7e319cce4470d9c6478c6dc/lib/ui/channel_buffers.dart#L574

During the review of the iOS/macOS implementation, #44848 (comment), we agreed that the existing naming is confusing because it implies that overflow will be allowed, but this not the case this function is used to enable/disable error messages when a channel overflows. 

## Related Issue

Follow-up for flutter/flutter#132386.

## Tests

Updates 1 test.
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
#44848)

## Description

This PR update the helper function that invokes the control channel 'resize' command (previous implementation relied on a deprecated format). It also adds a similar helper function for the 'overflow' commands exposed by the control channel.

See:

https://github.com/flutter/engine/blob/93e8901490e78c7ba7e319cce4470d9c6478c6dc/lib/ui/channel_buffers.dart#L302-L309

## Related Issue

iOS and macOS implementation for flutter/flutter#132386

Similar implementations:
- Android: #44434
- Linux: #44636

## Tests

Adds two tests.
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
#46361)

## Description

This PR is a follow-up to #44434 which introduces the `allowChannelBufferOverflow` function. It renames this function to `setWarnsOnChannelOverflow`.

The previous naming was inspired by the framework side implementation.
https://github.com/flutter/engine/blob/93e8901490e78c7ba7e319cce4470d9c6478c6dc/lib/ui/channel_buffers.dart#L574

During the review of the iOS/macOS implementation, #44848 (comment), we agreed that the existing naming is confusing because it implies that overflow will be allowed, but this not the case this function is used to enable/disable error messages when a channel overflows. 

## Related Issue

Follow-up for flutter/flutter#132386.

## Tests

Updates 1 test.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android - BasicMessageChannel.resizeChannelBuffer should use a non deprecated format and be more efficient
5 participants